<template>
  <div id="navIndex">
    
    <div id="navBar">
      <van-nav-bar
        :title="meta.navTitle"
        left-text="返回"
        left-arrow
        fixed
        @click-left="onClickNavBarLeft"
      />
    </div>
    
    <div id="navPages">
      <router-view></router-view>
    </div>

  </div>
</template>
<style scoped lang='scss'>
#navIndex {
  width: 100%;
  height: 100%;
  #navPages {
    height: calc(100% - 50px);
    overflow-y: scroll;
  }
  #navBar {
    height: 50px;
  }
}

</style>
<script lang="ts">
// @ is an alias to /src
import { Component, PropSync,Prop ,Vue, Watch, Model } from 'vue-property-decorator';
import {NavBar} from 'vant';
import store from '../store/index';
import router from '../router';

Vue.use(NavBar);

@Component
export default class NavIndexComponent extends Vue {
  //@Prop() private title: string = '';
  private meta: any = {navTitle: ''};

  created(){
    this.meta=router.currentRoute.meta;
  }

  private onClickNavBarLeft(){
    router.back();
  }
}
</script>
